<?
include 'config/config.inc.php';
include '../source/includes/smart.class.php';
rinnovaSessione(true);
header('Content-Type: text/html; charset=UTF-8');
switch($_POST['op']) {
	case "getElenco":
		die(Smart::getElenco($_POST['min'],$_POST['max'],$_POST['orderby'],$_POST['where']));
		break;
		
	case "salva":
		$_POST = decodeUtf8Array($_POST);
		die(Smart::salva($_POST['id'],$_POST['codice'],$_POST['modello'],$_POST['sim']));
		break;
		
	case "getRecord":
		die(Smart::getRecord($_POST['id']));
		break;
		
	case "elimina":
		die(Smart::elimina($_POST['id']));
		break;
		
	case "cerca":
		$_POST = decodeUtf8Array($_POST);
		die(Smart::cerca($_POST['search']));
		break;
}
?>